<%@ page language="java" import="java.util.*,SiTuQingYou.vo.*,SiTuQingYou.util.*" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%
      String path = request.getContextPath();
    %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="<%=path%>/houtai/js/jquery-3.3.1.min.js"></script>
<style type="text/css">
	.page{width:100%;height:100vh;}
    .tit{width:100%;height:80px;font-size:40px;font-weight:900px;color:darkcyan;text-align:center;margin-top:30px;}
    .reviseinfo{text-align:center;width:600px;height:300px;margin:0px auto;background-color:#ddd;color:purple;font-size:15px;padding-top:40px;font-weight:700;}
</style>

    <script type="text/javascript">
    $(document).ready(load);
    
    function load()
    {
	    $("#revisepw").submit(sumb);
    }
    
    function sumb(){
    	var f1 = checkpassword();
    	var f2 = checkrepassword();
    	return f1&&f2;
    }
    
    function checkpassword(){
    	var regExp = new RegExp("^[a-zA-Z0-9_]{6,12}$");
    	var pw1 = $("#password1").val();
    	var flag1 = regExp.test(pw1);
    	if(flag1)
    	{
    		$("#password1").next().html("√");
    		$("#password1").next().css("color","green");
    		return true;
    	}
    	else
    	{
    		$("#password1").next().html("<br/>密码应是6-12位数字、字母");
    		$("#password1").next().css("color","red");
    		return false;
    	}
    }
    
    function checkrepassword(){
        var pw2=$("#password2").val();
        var pw1=$("#password1").val();
    	
    	if(pw1==pw2&&pw2!=null&&pw2!="")
    	{
    		$("#password2").next().html("√");
    		$("#password2").next().css("color","green");
    		return true;
    	}
    	else
    	{
    		$("#password2").next().html("<br/>密码输入应一致");
    		$("#password2").next().css("color","red");
    		return false;
    	}
    }
    
    </script>

</head>
<body>
 <div class="page">
    <jsp:include page="header.jsp"></jsp:include>
   
    <div class="tit"><font face="隶书"> 修改密码</font></div>
    
    <div class="reviseinfo">
       <form id="revisepw" method="post" action="/SiTuQingYou/LookForPasswordServlet?method=toRevise">
                          修改密码：<input type="password" name="newpassword" onblur="checkpassword()" id="password1"><span></span>
              <br/><br/>
                          再次输入密码：<input type="password" id="password2" onblur="checkrepassword()" id="password2"><span></span>
         	  <br/><br/>
          <input type="submit" value="提交修改">
       </form>
    </div>
    
    </div>
    <jsp:include page="footer.jsp"></jsp:include>
</body>
</html>